﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JumpNFight.Simulation;
using Microsoft.Xna.Framework;
using XDL.Framework.Messaging;
using XDL.Framework;

namespace JumpNFight.Weapons
{
    class Grenade :
        BalisticWeaponBase
    {
        Moveable m_moveable;
        public override Moveable  Moveable
        {
            get
            {
                return m_moveable;
            }
        }

        public Grenade(World world, int playerId, Vector2 position, Vector2 velocity):
            base(world, playerId,position,velocity)
        {
            this.Lifetime = Configuration.GrenadeLifetime;
            m_moveable = new ElasticMoveable(GetNextID()) { Elasticity = 0.8f };
            m_moveable.Width = 16;
            m_moveable.Height = 16;
            m_moveable.GroundDrag = 10f;
            m_moveable.Position = position;
            m_moveable.Velocity = velocity;
            m_moveable.Mass = 80;
            m_moveable.MaxSpeed = 450;
            m_moveable.TileX = (int)Math.Floor(Moveable.Position.X / World.UnitToPixel);
            m_moveable.TileY = (int)Math.Floor(Moveable.Position.Y / World.UnitToPixel);
        }
    }
}
